package com.slliver.pay.controller;


import com.slliver.commonmodel.pay.Pay;
import com.slliver.pay.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RequestMapping("/api/pay")
@RestController
public class PayController {

    @Autowired
    private PayService payService;

    // http://localhost:6001/api/pay/createPay?userId=1000&productId=1000
    @GetMapping("/createPay")
    public Pay createPay(@RequestParam("userId") Long userId, @RequestParam("productId") Long productId){
        return payService.savePay(userId, productId);
    }

    // http://localhost:6001/getWeather
    @GetMapping("/getWeather")
    public String  getWeather(){
        return payService.getWeather();
    }

}
